module.exports = {
	publicPath: './',
	outputDir: "dist",
	assetsDir: 'static',
	lintOnSave: false,
	productionSourceMap: false,
	devServer: {
		proxy: {
			'/x': {
				target: 'https://api.bilibili.com',
				changeOrigin: true,
				onProxyReq(proxyReq){
					proxyReq.setHeader('origin', 'https://www.bilibili.com')
					proxyReq.setHeader('referer', 'https://www.bilibili.com/v/channel?spm_id_from=333.851.b_7072696d61727950616765546162.4')
				}
			},
			'/twirp': {
				target: 'https://manga.bilibili.com',
				changeOrigin: true,
				onProxyReq(proxyReq){
					proxyReq.setHeader('origin', 'https://manga.bilibili.com')
					proxyReq.setHeader('referer', 'https://manga.bilibili.com/eden/bilibili-nav-panel.html')
				}
			},
			'/xlive': {
				target: 'https://api.live.bilibili.com',
				changeOrigin: true,
				onProxyReq(proxyReq){
					proxyReq.setHeader('origin', 'https://live.bilibili.com')
					proxyReq.setHeader('referer', 'https://live.bilibili.com/')
				}
			},
			// 请求select地区的数据，报错
			'/web': {
				target: 'https://passport.bilibili.com',
				changeOrigin: true,
				onProxyReq(proxyReq){
					proxyReq.setHeader('referer', 'https://passport.bilibili.com/login')
				}
			},
			// 用户数据
			'/api': {
				target: 'http://study.yuanjin.tech',
				changeOrigin: true
			}
		}
	}
}